-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[xdoctest][task skip_no_reason 8-11] add skip reason for jit sample code #57676
[xdoctest][task skip_no_reason 8-11] add skip reason for jit sample code #57676
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
python/paddle/jit/api.py
Outdated
@@ -1368,7 +1369,7 @@ def load(path, **configs): | |||
.. code-block:: python | |||
:name: code-example1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
奇怪,code-example2 一直不过,但本地可以过 @megemini
看着像多进程导致的问题?但我用的是最新版 convert-doctest 呀
另外 TracedLayer 三个报错先不用管,TracedLayer 目前已经不用了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯 ... ... 之前其实一直担心,使用多进程可能会对 paddle 本身有一定副作用 ~
这里 paddle 内部也用了多进程(应该是加载数据用的),不能嵌套进程,即使按照报错信息不用 daemon,也会因为不能 pickle 而报错 ~
有个办法,加个全局 directive,让这个用例不在子进程运行,看看行不?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里 paddle 内部也用了多进程(应该是加载数据用的),不能嵌套进程,即使按照报错信息不用 daemon,也会因为不能 pickle 而报错 ~
可是 convert-doctest 为什么没问题呢?这俩按理说是一样的呀?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我在 aistudio 上也报错 ~
你是在本地 mac 运行的?
不同系统对于 multiprocessing 处理不一样 ... ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paddle 目前强制用的 fork
:
Paddle/python/paddle/reader/decorator.py
Lines 29 to 42 in 395ffbf
# On macOS, the 'spawn' start method is now the default in Python3.8 multiprocessing, | |
# Paddle is currently unable to solve this, so forces the process to start using | |
# the 'fork' start method. | |
# | |
# TODO: This solution is not good, because the fork start method could lead to | |
# crashes of the subprocess. Figure out how to make 'spawn' work. | |
# | |
# For more details, please refer to | |
# https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods | |
# https://bugs.python.org/issue33725 | |
if sys.version_info >= (3, 8) and sys.platform == 'darwin': | |
fork_context = multiprocessing.get_context('fork') | |
else: | |
fork_context = multiprocessing |
出错的 _DataLoaderIterMultiProcess
也是用的默认的 multiprocessing.Process
,linux 下是 fork
,mac 下是 spawn
~
fork
is fast, unsafe, and maybe bloated,另参考 Fork vs Spawn in Python Multiprocessing, 所以当时我是强制用的 spawn
。
我试过用 fork
,虽然快,但是问题更多 ... ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你是在本地 mac 运行的?
嗯嗯对
有个办法,加个全局 directive,让这个用例不在子进程运行,看看行不?
那看样子只能这样了~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR: #57692 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把那个 load 的冲突解决一下应该就没问题了吧 ?~
奇怪,我 rerun CI 了,但好像没有效果,我 merge 一下重新触发试试吧 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
Others
Description
为之前没有说明 skip reason 的示例代码添加 skip reason,本 PR 为 jit 下所有相关代码添加
@megemini @sunzhongkai588
Related links
PCard-66972